package com.cskaoyan.controller.admin;

import com.cskaoyan.bean.BaseData;
import com.cskaoyan.bean.bo.*;
import com.cskaoyan.bean.pojo.*;
import com.cskaoyan.bean.vo.AddressVO;
import com.cskaoyan.bean.vo.BaseRespVo;
import com.cskaoyan.service.UserService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.omg.CORBA.PUBLIC_MEMBER;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("admin")
public class UserController {


    @Autowired
    UserService userService;
    /**
     * @Author Chunlai
     * @description: admin/user/list
     * @Date 9:27 2021/7/9
     * url: user/list
     */


    @GetMapping(value = "user/list" , params = {"page","limit","sort","order"})
    @RequiresPermissions("admin:user:list")
    public BaseRespVo list(UserParam param) {
        BaseData<MallUser> userBaseData = userService.queryUser(param);
        return BaseRespVo.ok(userBaseData);
    }

    /**
     * @Author Chunlai
     * @description: admin/address/list
     * @Date 9:27 2021/7/9
     * url:
     */
    @GetMapping(value = "address/list" ,params ={"page","limit","sort","order"})
    @RequiresPermissions("admin:address:list")
    public BaseRespVo address(AddressParam param){
        BaseData<AddressVO> addressBaseData = userService.queryaddress(param);
        return BaseRespVo.ok(addressBaseData);
    }
    /**
     * @Author Chunlai
     * @description: admin/collect/list
     * @Date 9:27 2021/7/9
     * url:
     */
    @GetMapping(value ="collect/list" , params = {"page","limit","sort","order"})
    @RequiresPermissions("admin:collect:list")
    public BaseRespVo enshrine(CollectParam param){
        BaseData<MallCollect> collectBaseData = userService.queryenshrine(param);
        return BaseRespVo.ok(collectBaseData);
    }
    /**
     * @Author Chunlai
     * @description: admin/footprint/list
     * @Date 9:28 2021/7/9
     * url:
     */
    @GetMapping(value ="footprint/list" , params = {"page","limit","sort","order"})
    @RequiresPermissions("admin:footprint:list")
    public BaseRespVo footprint(FootParam param){
        BaseData<MallFootprint> mallFootprintBaseData= userService.queryfoot(param);
        return BaseRespVo.ok(mallFootprintBaseData);
    }
    /**
     * @Author Chunlai
     * @description: admin/history/list
     * @Date 9:29 2021/7/9
     * url:
     */
    @GetMapping(value ="history/list" , params = {"page","limit","sort","order"})
    @RequiresPermissions("admin:history:list")
    public BaseRespVo history(HistoryParam param){
        BaseData<MallSearchHistory> mallSearchHistoryBaseData= userService.queryhistory(param);
        return BaseRespVo.ok(mallSearchHistoryBaseData);
    }
    /**
     * @Author Chunlai
     * @description: admin/feedback/list
     * @Date 9:29 2021/7/9
     * url:
     */
    @GetMapping(value = "feedback/list",params ={"page","limit","sort","order"})
    @RequiresPermissions("admin:feedback:list")
    public BaseRespVo feedback(FeedBackParam param){
        BaseData<MallFeedback> mallFeedbackBaseData=userService.queryfeedback(param);
        return BaseRespVo.ok(mallFeedbackBaseData);
    }

}
